home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 050a.dms / 050a.adf / TEXTS / chapter19.txt < prev    next >
Text File  |  1992-02-26  |  5KB  |  131 lines

  1.                      The Absolute Beginners Guide To Amos
  2.                      ------------------------------------
  3.                                Chapter Nineteen
  4.                                ----------------
  5. In this chapter I will be covering the more important of Amos`s drawing 
  6. commands.
  7.  
  8. PLOT
  9. ----
  10. Looking at the Amos manual I can`t think of any other way to explain this
  11. simple command.  PLOT draws a single pixel of colour on your screen at the
  12. specified coordinates i.e.
  13.  
  14. PLOT 0,0
  15.  
  16. Would PLOT a pixel of the current INK colour at the very top left hand edge
  17. of your screen.  The X coordinates (Across) Range from 0 to 319 in Lowres and
  18. 0 to 639 in Hires. The Y coordinates go from 0 to 255 (the second 0 in the 
  19. example) in Pal mode and 199 in NTSC mode. We normally use PAL mode in the
  20. UK. NTSC is for compatibility with some other countries including the USA.
  21.  
  22. Just a quick word about INK, which we haven`t covered yet. 
  23. The reason I haven`t explained the INK command so far was to save confusion
  24. with the PEN command.
  25. PEN, if you remember, controls the colour of PRINTED text.  
  26. INK on the other hand controls the colour of graphic drawing operations like
  27. PLOT and the rest of the commands we will be examining in this chapter.  
  28. INK also controls the colours of another command called TEXT, but forget that
  29. for now.
  30.  
  31. Getting back to the PLOT command, we can add an INK option to the PLOT 
  32. command like this:
  33.  
  34. PLOT 0,0,1
  35.  
  36. This will PLOT a pixel at 0,0 in INK colour 1.  
  37.  
  38. Try typing this line into Amos.
  39.  
  40. FOR A=1 to 1000: PLOT RND(319), RND(199),RND(15): NEXT A
  41.  
  42. You should be able to work out exactly what this line does, if not check 
  43. out each command from previous chapters or check your notes.  
  44. As an exercise try doing a break down of this line yourself. It saves me 
  45. doing it!
  46.  
  47. DRAW
  48. ----
  49. DRAW a line.  The DRAW command is virtually the same set up as PLOT except
  50. you must give a second set of coordinates.  The start of your line and the
  51. end coordinates of your line:
  52.  
  53. DRAW 0,0 TO 100,0
  54.  
  55. Will DRAW a straight line 100 pixels long from the top left hand edge of your
  56. screen.  DRAW uses the current INK setting as it`s colour.
  57. You can DRAW some nice patterns with this command see EXAMPLE19.Amos for some
  58. ideas.
  59.  
  60. As we have covered screen coordinates quite a lot, from now on I will 
  61. refer to any set of coordinates as X and Y.  X is across the screen and Y is 
  62. up and down the screen.  For example:
  63.  
  64. PLOT x,y
  65.  
  66. DRAW x1,y1 TO  x2,y2
  67.  
  68. X just means insert your x coordinate here and the y, the y coordinates.
  69. x1,y1 to x2,y2 simply means the second set of x,y coordinates in the same 
  70. command.
  71.  
  72. Why am I complicating things? Well this is standard practice and you will 
  73. need to know this to understand the Amos manual and other more advanced 
  74. tutorials.
  75.  
  76. BOX
  77. ---
  78. Here is a very useful and easy to use command.  
  79. BOX draws a BOX on screen at the specified coordinates:
  80.  
  81. BOX x1,y1 TO x2,y2
  82.  
  83. X1,Y1 are the coordinates of the top left hand edge of the box.
  84. X2,Y2 are the coordinates of bottom right edge of your box.
  85. See EXAMPLE19.Amos for the BOX command in action.
  86.  
  87.  
  88. CIRCLE x,y,r
  89. ------------
  90. The CIRCLE command, believe it not, draws a triangle on the screen!!! Only
  91. kidding, it draws a CIRCLE of course.  X an Y are the coordinates of the 
  92. centre of the circle and R stands for the radius (size) of the circle.
  93. For example:
  94.  
  95. CIRCLE 100,90,50
  96.  
  97. The dead centre of the circle will be 100 across and 90 pixels down the
  98. screen and the radius will be 50 pixels.  See EXAMPLE19.Amos
  99.  
  100.  
  101. BAR x1,y1 TO  x2,y2
  102. -------------------
  103. This command draws a filled rectangle (a bar) using the same coordinates 
  104. system as DRAW.
  105.  
  106. In any of the above commands you can leave out the x,y coordinates altogether
  107. but you must leave a comma in each place instead like this:
  108.  
  109. PLOT ,
  110.  
  111. What Amos will do in this case is PLOT a pixel at the current position of the
  112. GRAPHICS CURSOR, do not confuse this with the TEXT CURSOR.
  113. This is useful to remember as a lot of other Amos commands utilize this 
  114. trick.  Check the manual for which commands use the ,, trick.
  115.  
  116. If you need to find out the current position of the graphics cursor then 
  117. you can use the XGR and YGR commands:
  118.  
  119. X=XGR
  120. Y=YGR
  121.  
  122. Now X will hold the X coordinate and Y the Y coordinate of the graphics
  123. cursors current position.
  124.  
  125. There are quite a few more drawing functions in Amos, most people will never
  126. use more than I have described here so I think I have taken you far enough
  127. down this road, for now at least.
  128.  
  129.                            End of chapter nineteen
  130.                            ^^^^^^^^^^^^^^^^^^^^^^^
  131.